import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false

App.mpType = 'app'

// 引入全局uView
import uView from 'uview-ui'
Vue.use(uView);
//tabbar 
import tabbar from 'common/tabbar.js' 
Vue.prototype.$tabbar = tabbar
//tools工具
import tools from 'common/Tool.js' 
Vue.prototype.$tools = tools
//  引入ColorUI
import cuCustom from 'common/colorui/components/cu-custom.vue';
Vue.component('cu-custom', cuCustom);
// AES加密
import AES from '@/components/ar-aes/ar-aes.js'
Vue.prototype.AES = AES.AES
//router
import {router,RouterMount} from './router.js'  //路径换成自己的
Vue.use(router)

const app = new Vue({
	...App
})
// http拦截器，此为需要加入的内容，如果不是写在common目录，请自行修改引入路径
import httpInterceptor from '@/common/http.interceptor.js'
// 这里需要写在最后，是为了等Vue创建对象完成，引入"app"对象(也即页面的"this"实例)
Vue.use(httpInterceptor, app);

import httpApi from '@/common/http.api.js'
Vue.use(httpApi, app);

// 导入组件
import store from "./store";
import toast from './components/toast/toast.vue'
// 注册组件
Vue.component('toast',toast)
Vue.prototype.$store = store;
function loading(tf) {
    store.commit("switch_loading", tf) 
}
Vue.prototype.$loading = loading;
// #ifdef H5
RouterMount(app,router,'#app')
// #endif

// #ifndef H5
app.$mount(); 
// #endif
